<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>
<%@ include file="/WEB-INF/views/shared/taglib.jsp"%>

<%@ include file="/WEB-INF/views/shared/master/contentHeader.jsp"%>
<%@ include file="/WEB-INF/views/shared/master/index.jsp"%>

<%
	String excelId = request.getParameter("excelId");
	session.setAttribute("excelId", excelId);
%>

<style type="text/css">
</style>

<t:form action="/admin/data/index" ajaxPost="true" onSuccess="onSuccess">
	<t:panel cssClass="panel-flat border-top-xlg border-top-primary"
		customBody="true" customHead="true">
		<t:panelHead title="实验数据表填写"></t:panelHead>
		<div class="panel-body">
			<div class="row">
				<c:import url="input.jsp" />
			</div>
			<div id="tableContent" class="row">
				<div id="tabs" class="row">
					<c:import url="tabs.jsp" />
				</div>
				<c:import url="output.jsp" />
			</div>
		</div>
	</t:panel>
</t:form>

<script type="text/javascript">
function onSuccess(res){
	
}
function actionResultCallBack(){
	var baseOperate={
			close:false,
			refresh:false
	}
	return baseOperate;
}
	function addTab(){
		alert("11");
		var excelId = "<%=excelId%>";
		var url = $.getVirtualPath() + "/admin/experimentExcel/data/index";
		var data = "topMenuId=" + menuId + "&ajaxPost=true" + "&label=true"
				+ "&excelId=" + excelId;
		var htmlContent = $.getTextPost(url, data);
		c.log(htmlContent);
		$("#tabs").html(htmlContent);
		formSubmit();
		reload();
		$(".nav.nav-tabs li").on("shown.bs.tab", function(e) {
			alert("555");
			formSubmit();
			reload();

		});
		//bindOutputClick();
		//$("#ul").append("<li data-menuId='' data-menuName='' class='active'><a href='#bordered-justified-tab1' data-toggle='tab'> <i class='text-primary'></i>new Tab</a></li>");
	}

	function getMenuId() {
		return $(".nav.nav-tabs li.active").attr("data-menuId");
	}
	function formSubmit() {
		window.menuId = getMenuId();
		alert(menuId);
		//var url = $.getVirtualPath() + "/admin/data/index";
		//var data = "topMenuId=" + menuId + "&ajaxPost=true";
		//var htmlContent = $.getTextPost(url, data);

		//$(".output.tab-content").html(htmlContent);

		//bindOutputClick();
	}
	$(function() {
		init();
		
		formSubmit();
		reload();

		$(".nav.nav-tabs li").on("shown.bs.tab", function(e) {
			alert("555");
			formSubmit();
			reload();

		});
	});

	function bindOutputClick() {
		$(".panel-paramRegist").on("click", function() {
			if ($(this).hasClass("bg-primary")) {
				$(this).removeClass("bg-primary");
			} else {
				$(".panel-paramRegist.bg-primary").removeClass("bg-primary");
				$(this).addClass("bg-primary");
			}
		});
	}
</script>

<%@ include file="/WEB-INF/views/shared/base/scripts/jqueryui.jsp"%>
<%@ include
	file="/WEB-INF/views/shared/base/scripts/limitless/default/formselects.jsp"%>

<%@ include file="/WEB-INF/views/shared//master/contentFooter.jsp"%>